/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
/**
 * @description InvOutputHeadMDaoImpl.java
 * @author dongbin
 * @version 
 * @copyright
 */

package com.erp.inv.outputeco.dao.hibernate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.redragon.framework.hibernate.DaoSupport;
import org.redragon.framework.hibernate.model.Pages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.erp.inv.outputeco.dao.InvOutputHeadMDao;
import com.erp.inv.outputeco.dao.model.InvOutputHeadM;

/**
 * @description
 * @date 2020年10月17日
 * @author dongbin
 * 
 */
@Repository
public class InvOutputHeadMDaoImpl implements InvOutputHeadMDao {
    
    //注入DaoSupport工具类
    @Autowired
    private DaoSupport daoSupport;

    @Override
    public void insertDataObject(InvOutputHeadM obj) {
        // TODO Auto-generated method stub

    }

    @Override
    public void updateDataObject(InvOutputHeadM obj) {
        // TODO Auto-generated method stub

    }

    @Override
    public void insertOrUpdateDataObject(InvOutputHeadM obj) {
        // TODO Auto-generated method stub

    }

    @Override
    public void deleteDataObject(InvOutputHeadM obj) {
        // TODO Auto-generated method stub

    }

    @Override
    public List<InvOutputHeadM> getDataObjects() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public InvOutputHeadM getDataObject(int id) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public InvOutputHeadM getDataObject(String code) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<InvOutputHeadM> getDataObjects(InvOutputHeadM paramObj) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<InvOutputHeadM> getDataObjects(Pages pages) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<InvOutputHeadM> getDataObjects(Pages pages, InvOutputHeadM paramObj) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<Map<String, Object>> getDataObjectsArray(Pages pages, InvOutputHeadM paramObj) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<InvOutputHeadM> getDataObjectsForDataAuth(String dataAuthSQL, Pages pages, InvOutputHeadM paramObj) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public InvOutputHeadM getDataObject(String code, Integer version) {
        String sql = "select i.* from inv_output_head_m i where i.output_head_code = :code and i.version = :version";
        
        Map<String, Object> args = new HashMap<String, Object>();
        args.put("code", code);
        args.put("version", version);
        
        Map<String, Class<?>> entity = new HashMap<String, Class<?>>();
        entity.put("i", InvOutputHeadM.class);
        
        List<InvOutputHeadM> list = this.daoSupport.selectDataSql(sql, entity, args);
        if(list.size()>0) {
            return list.get(0);
        }
        
        return null;
    }

}
